<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>授权管理</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="/static/plugins/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/static/plugins/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="/static/plugins/bower_components/Ionicons/css/ionicons.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="/static/plugins/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="/static/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="/static/dist/css/skins/_all-skins.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
	<style type="text/css">
		 th, td { white-space: nowrap; }
              div.dataTables_wrapper {
                width: 900px;
                margin: 0 auto;
              }
              
           .bgc{
           	background-color: #0073B7 !important;
           	color: white !important;
           }
           .guanbi2,.bian2{
           	display: none;
           }
           
           .aa{
           	outline: none;
           	display: inline-block;
				    padding: 6px 12px;
				    margin-bottom: 0;
				    font-size: 14px;
            border:1px solid #ddd ;
            font-weight: 400;
				    line-height: 1.42857143;
				    white-space: nowrap;
				    vertical-align: middle;
				    -ms-touch-action: manipulation;
				    touch-action: manipulation;
				    -webkit-user-select: none;
				    -moz-user-select: none;
				    -ms-user-select: none;
				    user-select: none;
				    background-image: none;
				    border-radius: 4px;
           }
           .div_button{
           	/*position: absolute;
           	top: 0px;*/
           	text-align: center;
           }
           #example2_wrapper{
           	width: 450px;
           }
           #example1_wrapper{
           	width: 500px;
           }
	</style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
     <a href="#" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>系</b>统</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>后台</b>系统</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- Messages: style can be found in dropdown.less-->
          <li class="dropdown messages-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-envelope-o"></i>
              <span class="label label-success">4</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有4条短信</li>
              <li>
                <!-- inner menu: contains the actual data -->
                <ul class="menu">
                  <li><!-- start message -->
                    <a href="#">
                      <div class="pull-left">
                        <img src="/static/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                      </div>
                      <h4>
                       支持团队
                        <small><i class="fa fa-clock-o"></i>5分钟</small>
                      </h4>
                      <p>为什么不买一个新的令人敬畏的主题？</p>
                    </a>
                  </li>
                  <!-- end message -->
                </ul>
              </li>
              <li class="footer"><a href="#">看到所有的消息</a></li>
            </ul>
          </li>
          <!-- Notifications: style can be found in dropdown.less -->
          <li class="dropdown notifications-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-bell-o"></i>
              <span class="label label-warning">10</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有10的通知</li>
              <li>
                <!-- inner menu: contains the actual data -->
                <ul class="menu">
                  <li>
                    <a href="#">
                      <i class="fa fa-users text-aqua"></i>5名新成员加入了今天
                    </a>
                  </li>
                </ul>
              </li>
              <li class="footer"><a href="#">查看全部</a></li>
            </ul>
          </li>
          <!-- Tasks: style can be found in dropdown.less -->
          <li class="dropdown tasks-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-flag-o"></i>
              <span class="label label-danger">9</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有9个任务</li>
              <li>
                <!-- inner menu: contains the actual data -->
                <ul class="menu">
                  <li><!-- Task item -->
                    <a href="#">
                      <h3>
                       设计一些按钮
                        <small class="pull-right">20%</small>
                      </h3>
                      <div class="progress xs">
                        <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar"
                             aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                          <span class="sr-only">20% Complete</span>
                        </div>
                      </div>
                    </a>
                  </li>
                  <!-- end task item -->
                </ul>
              </li>
              <li class="footer">
                <a href="#">查看所有任务</a>
              </li>
            </ul>
          </li>
          <!-- User Account: style can be found in dropdown.less -->
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="/static/dist/img/user2-160x160.jpg" class="user-image img-circle" alt="User Image">
              <span class="hidden-xs php_username" ></span>
            </a>
            <ul class="dropdown-menu">
              <!-- User image -->
              <li class="user-header">
                <img src="/static/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">

                <p>
                  <span class="php_username"></span> - Web Developer
                  <small>Member since Nov. 2012</small>
                </p>
              </li>
              <!-- Menu Body -->
              <li class="user-body">
                <div class="row">
                  <div class="col-xs-4 text-center">
                    <a href="#">跟随者</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">特价</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">好友</a>
                  </div>
                </div>
                <!-- /.row -->
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a href="#" class="btn btn-default btn-flat">更改头像</a>
                </div>
                <div class="pull-right">
                  <a href="#" class="btn btn-default btn-flat">退出登录</a>
                </div>
              </li>
            </ul>
          </li>
          <!-- Control Sidebar Toggle Button -->
          <li>
            <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
          </li>
        </ul>
      </div>
    </nav>
  </header>

  <!-- =============================================== -->

  <!-- Left side column. contains the sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="/static/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p class="php_username"></p>
          <a href="#"><i class="fa fa-circle text-success"></i>在线</a>
        </div>
      </div>
      <!-- search form -->
      <form action="#" method="get" class="sidebar-form">
        <div class="input-group">
          <input type="text" name="q" class="form-control" placeholder="Search...">
          <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
        </div>
      </form>
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header daohang">导航菜单</li>
        
        
        </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        授权
        <small>管理</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="/usser/info"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="/power/list">授权管理</a></li>
        <li class="active">授权管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-6">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">授权管理</h3>
            </div>
            <!-- /.box-header -->
            
<!--           
            <div class="div_button">
           		<div class="dataTables_filter" id="searchDiv">
								<input placeholder="请输入姓名" name="input_name" class=" aa" type="text" likeoption="true">
								<div class="btn-group">
									<button type="button" class="btn btn-primary" data-btn-type="search" aria-controls="example2" id="cha_name">查询</button>
									<button type="button" class="btn btn-default" data-btn-type="reset" id="chongzhi">重置</button>
								</div>
							</div>
						</div>-->
					
					
            
            
            <div class="box-body">
              <table id="example2" class="table table-bordered table-hover display" width="100%">
                <thead>
                <tr>
                	<th>更新时间</th>
                    <th>编号</th>
                    <th>角色名称</th>
                  
                </tr>
                </thead>
                <tbody>
               
                </tbody>
                <tfoot>
                <tr>
                	<th>更新时间</th>
                    <th>编号</th>
                    <th>角色名称</th>
                  
                </tr>
                </tfoot>
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

        
        </div>
        <!-- /.col -->
        
        
        
         <div class="col-xs-6">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title h3-title"></h3>
            </div>
            
            <!--<div class="div_button">
           		<div class="dataTables_filter" id="searchDiv">
		            <div class="btn-group">
										<button type="button" class="btn btn-default bian" data-btn-type="edit" data-toggle="modal" data-target="#modal-bian">编辑</button>
										
								</div>
							</div>
						</div>-->
            <!-- /.box-header -->
            
            <div class="box-body" id="table1">
              <table id="example1" class="table table-bordered table-hover display" width="100%">
                <thead>
                <tr>
                    <th>编号</th>
                    <th>权限名称</th>
                  	<th>控制台行为</th>
                </tr>
                </thead>
                <tbody class="user-tbody">
               
                </tbody>
               
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

        
        </div>
        <!-- /.col -->
        
        
        
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 2.4.0
    </div>
    <strong>Copyright &copy; 2014-2016 <a href="https://adminlte.io">Almsaeed Studio</a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
      <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
      <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <div class="tab-pane" id="control-sidebar-home-tab">
        <h3 class="control-sidebar-heading">Recent Activity</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-birthday-cake bg-red"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                <p>Will be 23 on April 24th</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-user bg-yellow"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                <p>New phone +1(800)555-1234</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                <p>nora@example.com</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-file-code-o bg-green"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                <p>Execution time 5 seconds</p>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

        <h3 class="control-sidebar-heading">Tasks Progress</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Custom Template Design
                <span class="label label-danger pull-right">70%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Update Resume
                <span class="label label-success pull-right">95%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Laravel Integration
                <span class="label label-warning pull-right">50%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Back End Framework
                <span class="label label-primary pull-right">68%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

      </div>
      <!-- /.tab-pane -->
      <!-- Stats tab content -->
      <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
      <!-- /.tab-pane -->
      <!-- Settings tab content -->
      <div class="tab-pane" id="control-sidebar-settings-tab">
        <form method="post">
          <h3 class="control-sidebar-heading">General Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Some information about this general settings option
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Other sets of options are available
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Allow the user to show his name in blog posts
            </p>
          </div>
          <!-- /.form-group -->

          <h3 class="control-sidebar-heading">Chat Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Show me as online
              <input type="checkbox" class="pull-right" checked>
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Turn off notifications
              <input type="checkbox" class="pull-right">
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Delete chat history
              <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
            </label>
          </div>
          <!-- /.form-group -->
        </form>
      </div>
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->


<!-- jQuery 3 -->
<script src="/static/plugins/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/static/plugins/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="/static/plugins/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="/static/plugins/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="/static/plugins/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/plugins/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="/static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="/static/dist/js/demo.js"></script>
<!-- page script -->

<script type="text/javascript" src="/static/js/menu.js" ></script>


        <!--模态框编辑-->
 <div class="modal fade" id="modal-bian" >
          <div class="modal-dialog bian1" style="width: 300px;">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">提示</h4>
              </div>
              <div class="modal-body">
                <p>请选择要授权的行</p>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
          
           <div class="modal-dialog bian2" style="width: 520px;">
           <div class="modal-content"><div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-remove"></li></button>
	<h5 class="modal-title">授权</h5>
</div>

<div class="modal-body">

	<form id="user-form" name="user-form" class="form-horizontal bv-form" novalidate="novalidate">
		<!--<div class="box-body">-->
			<div >
				<div class="form-group has-feedback">
					<label for="name" class="col-sm-3 control-label ">角色名称</label>
					<div class="col-sm-8">
						<input type="text" class="form-control " id="name" name="name1" placeholder="姓名" data-bv-field="name"><i class="form-control-feedback" data-bv-icon-for="name" style="display: none;"></i>
					<small data-bv-validator="notEmpty" data-bv-validator-for="name" class="help-block" style="display: none;">请输入角色名称</small></div>
				</div>
			</div>
			
				
			
		<!-- /.box-body -->
		<div class="box-footer text-right">
			<!--以下两种方式提交验证,根据所需选择-->
			<button type="button" class="btn btn-default" data-btn-type="cancel" data-dismiss="modal">取消</button>
			<button type="button" class="btn btn-primary btn_gai" data-btn-type="save">提交</button>
		</div>
		<!-- /.box-footer -->
	<input type="hidden" value=""/>
	</form>

</div>
	

</div>
         
			</div>
          
          
        </div>
        <!-- /.modal -->

        
        <script>
		  $(function(){
		    	
		    	var id,rolename;
    $('#example2').DataTable({
    	 'bLengthChange': false, 
    	"searching":false,//
    	 "language": {
	     	"url":"/static/js/"+navigator.language+".json"
	       },
    	
    	
    	"processing":true,
    	"serverSide":true,
    	 "ajax": "/role/item",
        "columns": [
          { "data": "Time" ,	"orderable":false },//禁止排序
            { "data": "ID" },
            { "data": "RoleName",	"orderable":false   }//禁止排序
         
        ],

               
    });
    
    

    
    				$("#example2 tbody").on("click","tr",function (){
    					$(this).siblings().removeClass("bgc");
		    	 		$(this).addClass("bgc");
		    	 		rolename=$(".bgc td").eq(2).html();
		    	 		$('#table1').empty();
		    	 		$("#table1").append(
		    	 			'<table id="example1" class="table table-bordered table-hover display" width="100%">'+
                '<thead>'+
                '<tr>'+
                    '<th>编号</th>'+
                    '<th>权限名称</th>'+
                  	'<th>控制台行为</th>'+
              ' </tr>'+
                '</thead>'+
                '<tbody class="user-tbody">'+
               
                '</tbody>'+
               
             '</table>'
		    	 		);
		    	 		$('#example1').DataTable({
						  	 'bLengthChange': false, 
						  	"searching":false,//
						  	 "language": {
							     	"url":"/static/js/"+navigator.language+".json"
							       },
						    	
						  	"processing":true,
						  	"serverSide":true,
						  	 "ajax": {"url":"/power/info"	,
						  	 				"data":{
						  	 					rolename:rolename
						  	 				}
						  	 },
						      "columns": [
						        { "data": "ID" ,	"orderable":false },//禁止排序
						          { "data": "PowerName" ,"orderable":false },
						          { "data": "ControllerAction",	"orderable":false   }//禁止排序
						       
						      ]
						
						             
						  });
		    	 	})
    				
    			
    				$(".bian").click(function(){
    					if ($(".bgc").length==1) {
    							$(".bian1").css("display","none");
    						$(".bian2").css("display","block");
    						 $("[name=name1]").val($(".bgc td").eq(2).html());
		        		
    					} else{
    							$(".bian1").css("display","block");
    						$(".bian2").css("display","none");
    					}
    				})
    				
    			
		     /*编辑角色*/
//		     
//		     $(".btn_gai").click(function(){
//		         name = $("[name=name1]").val();
//		         id=$(".bgc td").eq(1).html();
//		         
//		     	$.ajax({
//		     		type:"get",
//		     		url:"/power/update",
//		     		async:true,
//		     		  data : {
//			            id : id,
//			            name : name,
//			           
//		          },
//		          success : function(data) {
//		          	console.log(data);
//		            var response = $.parseJSON(data);
//		           
//		            if (response['code'] == 0) {
//		               alert("更改成功");
//		                location.href="/role/list";
//		            }
//					
//		          }
//		     
//		     	});
//		     })
		    
		    /**/
				 })
		    
		    	 
		    </script>
</body>
</html>








